<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2023/8/3
 * Time: 17:29
 */

namespace app\model\video;


use app\model\BaseModel;

class VideoPartCronModel extends BaseModel
{
    protected $table = 'ting_video_part_cron';

    protected $primaryKey = 'part_cron_id';

    const CREATED_AT = 'createtime';

    const UPDATED_AT = 'updatetime';

    protected static $instance;

    public static function getInstance()
    {
        if(is_object(self::$instance)){
            return self::$instance;
        }

        self::$instance = new self();

        return self::$instance;
    }

    public function index($where, $field=[],$order = [])
    {
        $query = $this->getWhere($where);

        $field && $query->select($field);

        $data = $this->buildPage($query);
        $order && $query->orderBy($order[0],$order[1]);
        $query->orderBy('part_cron_id','desc');

        $data['data'] = $query->get();

        return $data;
    }
}